home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: May 10, 1997
- // Author: sw
- //
- // Procedure Name:
- // AEspotLightEffects
- //
- // Description:
- // Creates custom attribute editor controls for the spotLight Node
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
-
-
-
- //
- // Procedure Name:
- // AEdecayRegionNew
- //
- //
-
- global proc AEdecayRegionNew(string $intensity)
- //
- // Description:
- // Setup up button that makes decay regions.
- //
- {
- setUITemplate -pst attributeEditorTemplate;
- rowLayout -nc 3;
- text -l "Intensity Curve";
- button -l "Create"
- -c ("AEmakeDecayRegion " + $intensity) dr;
- symbolButton -i "inArrow.xpm"
- -c ("AEintensityCurvePointer " + $intensity) intensityPointer;
- setParent ..;
- setUITemplate -ppt;
- }
-
- //
- // Procedure Name:
- // AEdecayRegionReplace
- //
- //
-
- global proc AEdecayRegionReplace(string $intensity)
- //
- // Description:
- // Replace the button with the command to create
- // decay regions for the new light.
- //
- {
- button -e -c ("AEmakeDecayRegion " + $intensity) dr;
- button -e -c ("AEintensityCurvePointer " + $intensity) intensityPointer;
- }
-
- //
- // Procedure Name:
- // AEmakeCurve
- //
- //
-
- global proc string AEmakeCurve(string $curveName)
- {
- // create the param curve.
- string $newCurve = `createNode animCurveUU -n $curveName`;
-
- // set a few keyframes for the curve.
- setKeyframe -f 0 -v 1 $newCurve;
- setKeyframe -f 10 -v 0 $newCurve;
- setKeyframe -f 20 -v 1 $newCurve;
- setKeyframe -f 30 -v 0 $newCurve;
- setKeyframe -f 40 -v 1 $newCurve;
- setKeyframe -f 50 -v 0 $newCurve;
- setKeyframe -f 60 -v 1 $newCurve;
- setKeyframe -f 100 -v 0 $newCurve;
-
- return $newCurve;
- }
-
- //
- // Procedure Name:
- // AEmakeDecayRegion
- //
- //
-
- global proc AEmakeDecayRegion(string $intensity)
- //
- // Description:
- // Make a decay region for this light.
- //
- {
- // get the name of the light.
- string $lightName[];
- tokenize($intensity, ".", $lightName);
-
- string $newCurve = AEmakeCurve("IntensityCurve");
- string $attr = $newCurve + ".output";
-
- // connect the param curve to the intensity
- connectAttr $attr $intensity;
-
- // create a lightInfo node.
- string $lightInfoNode = `createNode lightInfo -n lightInfo`;
-
- // connect the light to the lightInfo node.
- $attr = $lightName[0] + ".worldMatrix";
- $attr2 = $lightInfoNode + ".worldMatrix";
- connectAttr $attr $attr2;
-
- // connect the lightInfoNode to the curve.
- $attr = $lightInfoNode + ".sampleDistance";
- $attr2= $newCurve + ".input";
- connectAttr $attr $attr2;
- }
-
- //
- // Procedure Name:
- // AEintensityCurvePointer
- //
- //
-
- global proc AEintensityCurvePointer (string $name)
- {
- string $intensityCurve[] = `listConnections $name`;
- select $intensityCurve[0];
- editSelected;
- }
-
-
- //
- // Procedure Name:
- // AEcolorRegionNew
- //
- //
-
- global proc AEcolorRegionNew (string $colorR,string $colorG,string $colorB)
- //
- // Description:
- // Setup up button that makes colour regions.
- //
- {
- setUITemplate -pst attributeEditorTemplate;
- rowLayout -nc 2;
- text -l "Color Curves";
- button -l "Create"
- -c ("AEmakeColorRegion " + $colorR + " " +
- $colorG + " " + $colorB ) colorRegion;
- setParent ..;
- setUITemplate -ppt;
- }
-
- //
- // Procedure Name:
- // AEcolorRegionReplace
- //
- //
-
- global proc AEcolorRegionReplace (string $colorR, string $colorG, string $colorB)
- //
- // Description:
- // Replace the button with the command to create
- // colour regions for the new light.
- //
- {
- button -e -c ("AEmakeColorRegion " + $colorR + " " +
- $colorG + " " + $colorB ) colorRegion;
- }
-
- //
- // Procedure Name:
- // AEmakeColorRegion
- //
- //
-
- global proc AEmakeColorRegion(string $colorR,string $colorG,string $colorB)
- //
- // Description:
- // Make a color region for this light.
- //
- {
- // get the name of the light.
- string $lightName[];
- tokenize($colorR, ".", $lightName);
-
- string $newCurveR = AEmakeCurve("RedCurve");
- string $attrR = $newCurveR + ".output";
-
- string $newCurveG = AEmakeCurve("GreenCurve");
- string $attrG = $newCurveG + ".output";
-
- string $newCurveB = AEmakeCurve("BlueCurve");
- string $attrB = $newCurveB + ".output";
-
- // connect the param curve to the colour
- connectAttr $attrR $colorR;
- connectAttr $attrG $colorG;
- connectAttr $attrB $colorB;
-
- // create a lightInfo node.
- string $lightInfoNode = `createNode lightInfo -n lightInfo`;
-
- // connect the light to the lightInfo node.
- $attrR = $lightName[0] + ".worldMatrix";
- $attrG = $lightInfoNode + ".worldMatrix";
- connectAttr $attrR $attrG;
-
- // connect the lightInfoNode to the curve.
- string $outDistance = $lightInfoNode + ".sampleDistance";
- $attrR = $newCurveR + ".input";
- $attrG = $newCurveG + ".input";
- $attrB = $newCurveB + ".input";
-
- connectAttr $outDistance $attrR;
- connectAttr $outDistance $attrG;
- connectAttr $outDistance $attrB;
- }
-
-
- //
- // Procedure Name:
- // AEspotLightGlowNew
- //
- //
-
- global proc AEspotLightGlowNew (string $lightGlow)
- {
- setUITemplate -pst attributeEditorTemplate;
-
- attrNavigationControlGrp -l "Light Glow"
- -at $lightGlow
- -ignoreNotSupported
- lightGlowControl;
-
- setUITemplate -ppt;
- }
-
- //
- // Procedure Name:
- // AEspotLightGlowReplace
- //
- //
-
- global proc AEspotLightGlowReplace (string $lightGlow)
- {
- attrNavigationControlGrp -edit
- -at $lightGlow
- -ignoreNotSupported
- lightGlowControl;
- }
-
- //
- // Procedure Name:
- // AEspotLightEffects
- //
- //
-
- global proc AEspotLightEffects ( string $nodeName )
- {
- // Spot Light Glow Effects
-
- editorTemplate -callCustom "AEspotLightGlowNew"
- "AEspotLightGlowReplace"
- "lightGlow";
-
- // decay Region Effect
-
- editorTemplate -callCustom "AEdecayRegionNew"
- "AEdecayRegionReplace"
- "intensity";
-
- // Color Region Effect
-
- editorTemplate -callCustom "AEcolorRegionNew"
- "AEcolorRegionReplace"
- "colorR"
- "colorG"
- "colorB";
- }
-
-
-
-